package com.king.demo04;

import com.king.demo02.UserServicImp;
import com.king.demo02.UserService;

/**
 * 动态代理的优点:
 * [静态代理的优点]
 * 一个动态代理类代理的是一个接口,就是代理的一类业务
 */
public class Client {
    public static void main(String[] args) {
        UserServicImp userServicImp = new UserServicImp();
        ProxyInvocationHandler pih = new ProxyInvocationHandler();
        pih.setTarget(userServicImp);
        UserService proxy = (UserService) pih.getProxy();
        proxy.delete();
    }
}
